< previous page page_232 next page >

Page 232
As is the case with the other dialog boxes, no fonts are actually changed when you use this dialog box. Instead, properties are put into the common dialog control. Therefore, after the ShowFont method, you need to take the font properties from the dialog control and assign them to the controls you want to change.
Flags for the Font Dialog Box
You can set quite a few flags to control the look and feel of the Font dialog box. Table 11.7 lists some of the more common ones.
Table 11.7 Flags for the Font Dialog Box.
Flag ConstantDescription
cdlCFANSIOnlyWhen this flag is set, the user cannot select a symbols-only font.
cdlCFBothWhen this flag is selected, both printer and screen fonts are displayed in the font selection window.
cdlCFFixedPitchOnlyWhen this flag is selected, only fixed-pitch fonts on the system will be displayed in the font selection window.
cdlCFLimitSizeWhen this flag is set, only font sizes between the Min and Max properties are displayed.
cdlCFPrinterFontsWhen this flag is set, only printer fonts are displayed in the font selection window.
cdlCFScalableOnlyWhen this flag is set, only scalable fonts are displayed in the font selection window.
cdlCFScreenFontsWhen this flag is set, only those fonts that can be used onscreen are displayed in the font selection window.
cdlCFTTOnlyWhen this flag is set, only TrueType fonts are displayed in the font selection window.

Color Dialog Box
Setting colors in your application is not a good idea because users can typically modify their Windows colors using the Control Panel. If you hard-code a color into the ForeColor or BackColor property of a control and the user has chosen that same exact color from the Control Panel, any text you put into the control will not show up.

 
< previous page page_232 next page >

If you like this book, buy it!